package com.group.project.hrms.service.impl;

import com.group.project.hrms.entity.StandardBonusFullAttendance;
import com.group.project.hrms.mapper.StandardBonusFullAttendanceMapper;
import com.group.project.hrms.service.IStandardBonusFullAttendanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

@Service
public class StandardBonusFullAttendanceService implements IStandardBonusFullAttendanceService {

    @Autowired
    private StandardBonusFullAttendanceMapper standardBonusFullAttendanceMapper;


    @Override
    public int insertStandardBonusFullAttendance(StandardBonusFullAttendance bonusFullAttendance) {
        return standardBonusFullAttendanceMapper.insert(bonusFullAttendance);
    }

    @Override
    public int deleteStandardBonusFullAttendance(StandardBonusFullAttendance bonusFullAttendance) {
        return standardBonusFullAttendanceMapper.deleteByPrimaryKey(bonusFullAttendance);
    }

    @Override
    public int updateStandardBonusFullAttendance(StandardBonusFullAttendance bonusFullAttendance) {
        return standardBonusFullAttendanceMapper.updateByPrimaryKey(bonusFullAttendance);
    }

    @Override
    public StandardBonusFullAttendance selectOneStandardBonusFullAttendance(StandardBonusFullAttendance bonusFullAttendance) {
        return null;
    }

    @Override
    public StandardBonusFullAttendance selectOneStandardBonusFullAttendanceByGroupID(String gid) {
        Example example = new Example(StandardBonusFullAttendance.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo("attendGroupId" , gid);
        return standardBonusFullAttendanceMapper.selectOneByExample(example);
    }

    @Override
    public List<StandardBonusFullAttendance> selectAllStandardBonusFullAttendance() {
        return standardBonusFullAttendanceMapper.selectAll();
    }
}
